<template>
    <div class="form-field">
        <h1 class="title">
            ~开始努力写代码了~
        </h1>
        <div class="form-wrapper">
            <div class="form-input" >
                <input type="text" placeholder="添加要做的事儿..." v-model="hh" >
            </div>
            <button class="submit-btn" type="submit">
                <span @click="arrAdd">提交</span>
            </button>
        </div>
    </div>
</template>
<script setup>
import mitts from "../utils/bus"
import { onMounted,ref } from 'vue';

    let hh = ref()
    let arrhh = ref([])
    onMounted(()=>{
        console.log(hh)
    })
    let arrAdd = function(){
        arrhh.value.push(hh.value)
        arrhh.value.reverse()
        console.log(arrhh.value)
        mitts.$emit("getSong",arrhh.value)
    }
</script>
<style scoped>
  .form-field .title {
    color: #00bfff;
    font-size: 22px;
    margin-bottom: 18px;
  }
  h1 {
    display: block;
    font-size: 2em;
    margin-block-start: 0.67em;
    margin-block-end: 0.67em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
  }
  .form-input {
    display: inline-block;
    flex-grow: .65;
    margin-right: 15px
  }

.form-input input {
    background: transparent;
    border: 0;
    border-bottom: 3px dashed #00bfff;
    font-size: 18px;
    outline: 0;
    padding: 5px 0 3px;
    width: 100%;
}

  .form-field {
    margin-top: 25px;
  }
  .submit-btn {
    background-color: initial;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    position: relative;
    -webkit-transform: rotate(4deg);
    transform: rotate(4deg);
    transition: -webkit-transform .25s cubic-bezier(.175,.885,.32,1.275);
    transition: transform .25s cubic-bezier(.175,.885,.32,1.275);
    transition: transform .25s cubic-bezier(.175,.885,.32,1.275),-webkit-transform .25s cubic-bezier(.175,.885,.32,1.275);
  }

.submit-btn span {
background-color: #fff;
border: 2px solid #494a4b;
border-radius: inherit;
display: block;
font-size: 16.5px;
padding: 0.34em 0.84em;
position: relative;
}
</style>